<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
	xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"
	xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
	layout:decorator="layout/default">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>员工列表</title>
</head>
<body>
	<div layout:fragment="content">
		<div class="row" style="margin-bottom: 12px;">
            <div th:replace="fragments/searchBox::topSearch"></div>
            <div class="col-lg-2 col-md-2 col-sm-2 col-xs-2">
                <shiro:hasPermission name="employee:new">
                    <a type="button" class="btn btn-sm btn-success pull-right"
                        title="创建新员工" th:href="@{/employeese/new}">创建新员工</a>
                </shiro:hasPermission>
            </div>
        </div>
		<div class="row">
			<div class="col-lg-12 col-md-12 col-sm-12 xol-xs-12">
				<div th:unless="${#lists.isEmpty(page.list)}"
					th:replace="employee/index::showEmployeese(${page.list}, true)"></div>
				<div
					th:replace="fragments/pagination::pagination(${'/employeese'}, ${page})"></div>
			</div>
		</div>
	</div>

	<div class="table-responsive"
		th:fragment="showEmployeese(employeeList, editable)">
		<table class="table table-striped table-hover table-condensed">
			<thead>
				<tr>
					<th>人员姓名</th>
					<th>联系电话</th>
					<th>传真号码</th>
					<th>电子邮件</th>
					<th th:if="${editable}"></th>
				</tr>
			</thead>
			<tbody>
				<tr th:each="employee : ${employeeList}" th:object="${employee}">
					<td><a href="#"
						th:href="@{/employeese/{id}(id=*{employeeId})}"
						th:text="*{employeeName}"> </a></td>
					<td th:text="*{phone}"></td>
					<td th:text="*{fax}"></td>
					<td th:text="*{email}"></td>
					<td th:if="${editable}">
						<div class="btn-toolbar pull-right hidden-print">
							<div class="btn-group btn-group-xs">
								<shiro:hasPermission name="employee:edit">
									<a class="btn btn-default" title="修改员工"
										th:href="@{/employeese/{id}/edit(id=*{employeeId})}">编辑</a>
								</shiro:hasPermission>
								<shiro:hasPermission name="employee:delete">
									<a class="btn btn-danger" title="删除该员工"
										onclick="if(confirm('确定删除?')==false)return false;"
										th:href="@{/employeese/{id}/del(id=*{employeeId})}">删除</a>
								</shiro:hasPermission>
							</div>
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</div>
</body>
</html>
